#include "aboutdialog.h"

#include <iconmanager.h>

#include <QtGui/QGridLayout>
#include <QtGui/QIcon>
#include <QtGui/QLabel>

using namespace core;
using namespace swp;

AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
{
    QGridLayout* layout = new QGridLayout(this);

    setWindowTitle(tr("About SPM"));

    QLabel* icon = new QLabel();
    icon->setPixmap(IconManager::getInstance()->icon(
        "SPMLogo").pixmap(256, 256));
    QLabel* header = new QLabel(tr("<h1>SPM</h1>"));
    QLabel* text = new QLabel(tr("<p>"
        "Software Process Modeler is software developed as Diploma project."
        "It uses familiar UML (though not fully featured) for modeling and "
        "custom CPN engine as simulation core."
        "</p>"
        "<p>"
        "Version 0.9 (32 bit)"
        "</p>"
        "<p>"
        "Copyright Jan Czopik (2012-2014)"
        "</p>"
        "<p>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR "
        "A PARTICULAR PURPOSE."
        "</p>"));
    text->setFixedWidth(350);
    text->setWordWrap(true);

    layout->addWidget(icon, 0, 0, 2, 1);
    layout->addWidget(header, 0, 1);
    layout->addWidget(text, 1, 1);

    layout->setSizeConstraint(QLayout::SetFixedSize);

    setLayout(layout);

    setModal(true);
}

AboutDialog::~AboutDialog()
{

}
